/**
 * Class GuiController
 */
package controller.Interface;

import javax.swing.text.BadLocationException;

import gui.ChatGUI;

import model.data.FileDescription;
import model.data.Interface.UserListInterface;

/**
 * Package controller.Interface Project ChatSystemG6 - INSA 4INFOA1 - 2013/2014
 * <P>
 * <li>Interface of the ChatGui with the chat controller defines methods that
 * handle sending signals by ChatControlleur</li>
 * <li> it implements the interface  RemoteUserListInterface</li>
 * 
 * @author Christelle SIAGO HAPPI
 */

public interface GuiController extends RemoteUserListInterface {
	/**
	 * manages the connection of a local user
	 * 
	 * @param username
	 *            : the login of the local user
	 */

	public void performConnect(String username);

	/**
	 * manages the disconnection of a local user
	 * 
	 * @param username
	 *            : the login of the local user
	 */

	public void performDisonnect(String username);

	/**
	 * submit the message to be sent
	 * 
	 * @param local
	 *            : the login of the local user
	 * @param remote
	 *            : the login of the remote user
	 * @param text
	 *            : the text message
	 */

	public void performMessage(String local, String remote, String text);

	/**
	 * get the received message
	 * 
	 * @param remote
	 *            : the login of the remote user
	 * @param text
	 *            : the text message
	 * @throws BadLocationException 
	 */

	public void performReceivedMessage(String remote, String text) throws BadLocationException;

	/**
	 * set a local user with a username
	 * 
	 * @param username
	 */

	public void setLocalUser(String username);

	/**
	 * gets the answer of the remote user when he receives a file request
	 * 
	 * @param remoteUser
	 * @param isAgree
	 *            : the response of the remoteUser
	 * @param file
	 *            : the description of the file to be sent
	 * @param fileSize
	 *            : the size of the file to be sent
	 */

	public void performSendAnswer(String remoteUser, boolean isAgree,
			FileDescription file, long fileSize);

	/**
	 * submit a file request to a remote user
	 * 
	 * @param file
	 *            : the file to be sent
	 * @param username
	 */

	public void performFileRequest(FileDescription file, String username);

	/**
	 * 
	 * @return the userList
	 */
	public UserListInterface getUserList();

	/**
	 * 
	 * @return the ChatGUI of the running controller
	 */

	public ChatGUI getGUI();

	/**
	 * 
	 * @return the localUser
	 */

	public String getLocalUser();

	/**
	 * called when the user want to send a wizz to a remote user
	 * 
	 * @param remoteUser
	 */

	public void performSendWizz(String remoteUser);

	/**
	 * called when the local user changed his status
	 * @param status
	 */

	void performStatus(String status);

	/**
	 * is called when the user is typing a message
	 * @param rUserName
	 * @param isWriting
	 */

	public void performRemoteIsWriting(String rUserName, boolean isWriting);

}
